Skip to content

Potential fix for shields and spears#63

Open
tangoethan wants to merge 1 commit intosnackbag:mainfrom
tangoethan:main
Open

Potential fix for shields and spears#63
tangoethan wants to merge 1 commit intosnackbag:mainfrom
tangoethan:main

Conversation

@tangoethan
Copy link

@tangoethan tangoethan commented Jan 20, 2026

Changes the getMaxUseTime Item Mixin to exclude shields and spears.
This should fix the occasional damage applying through shields and spears acting weird.
Most of my testing was on 1.21.9-1.21.11, but this change should work on older versions that have the shield bug, and not affect those that don't (I did a quick code check for 1.19.2+).

Alternatively, I believe adding || original == 72000 to the if statement would also work.

Resolves #62 and resolves #42

Changes the getMaxUseTime Item Mixin to exclude shields and spears.
Fixes occasional damage applying through shields and spears acting weird.
@tangoethan tangoethan changed the title Fix shields and spears Potential fix for shields and spears Jan 20, 2026
@Lemonnik6484
Copy link
Collaborator

Thank you for this fix, I'll test it later today and leave my review

@Lemonnik6484 Lemonnik6484 requested a review from JXSnack January 20, 2026 11:29
@JXSnack
Copy link
Member

JXSnack commented Jan 20, 2026

This is awesome! How did you come to this solution? Nevermind, I'm blind

Copy link
Member

@JXSnack JXSnack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Tested in multiplayer 1.21.11 - works as intended without any visible side effects

@JXSnack JXSnack requested a review from Lemonnik6484 January 20, 2026 16:28
Copy link
Collaborator

@Lemonnik6484 Lemonnik6484 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@ench233
Copy link

ench233 commented Feb 7, 2026

good waht???
image
and in mixin L1:
if (!TT20.config.enabled() || !TT20.config.eatingAcceleration() || original == 0) return original;

so this pr fixed air lol..how did you passed test?

@ench233
Copy link

ench233 commented Feb 8, 2026

add check of original == 72000 can solve shield issue, but im not sure if it affects on spear

@JXSnack
Copy link
Member

JXSnack commented Feb 8, 2026

I have no idea what you're talking about. Maybe give some additional context to what you mean instead of giving destructive feedback?

Please state:

  • the Minecraft version
  • your concern
  • explanation on why this doesn't work

This PR fixes both the shield and spear issue. I've tested it and I can show you the individual pieces of code that do this.

@Lemonnik6484
Copy link
Collaborator

Lemonnik6484 commented Feb 8, 2026

I believe that || original == 0 was supposed to prevent second return from being recalculated. As we saw it did not work like that, so now we have ordinal = 0 which forces only first return to be edited. In fact the solution is still the same, but uses a different approach that obviously works now. So we can probably remove that || original == 0.

Anyways, be polite next time and explain what you mean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spear dash doesn't work in 1.21.11 Breaks shield behaviour

4 participants